package znzz.db.util.datasource;

/**
 * 多数据源切换
 * <p/>
 * Created by wangjwm on 2017/7/5.
 */
public class DataSourceSwitch {

    private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();

    public static void setDataSourceType(String dataSourceType) {
        contextHolder.set(dataSourceType);
    }

    public static String getDataSourceType() {
        return contextHolder.get();
    }

    public static void clearDataSourceType() {
        contextHolder.remove();
    }

}
